# '''for in 循环语句输出9*9乘法表'''
#  方法1
for row in range(1,10):
    for col in range(1,row+1):
#向左对齐，空4格
        print("{}*{}={:<4}".format(row,col,row*col),end=" ")
    print(' ')
print('='*80)
#
# # for 循环方法2
for row in range(9,0,-1):
    for col in range(1,row+1):
        print('{}*{}={:<4}'.format(row,col,row*col),end=' ')
    print(' ')
print('='*80)
#
# for 循环方法3
for row in range(1,10):
    for spack in range(1,10-row):
        print(end='        ')
    for col in range( row,0,-1):
        print('{}*{}={:>2}\t'.format(row,col,col*row),end="")
    print('')
print('='*80)

#  for 循环方法4

for row in range(9,0,-1):
    for spack in range(1,10-row):
        print(end='        ')
    for col in range(row,0,-1):
        print('{}*{}={:>2}'.format(row,col,row*col),end='  ')
    print(' ')
print(('='*80))




# while 循环方法1
i=1
while i<10:
    j=1
    while  j<=i:
            print('{}*{}={:<2}'.format(i, j, i * j),end=" ")
            j += 1
    print('\n')
    i+=1
print('')
print('='*80)

# while 循环方法2
m = 9
while m > 0:
    n = 1
    while n < m + 1:
        print("{}*{}={:<2}".format(n, m, m * n), end = " ")
        n += 1
    print("\n")
    m -= 1

print("=" * 80)
# while 循环方法3
m = 1
while m < 10:
    l = 1
    while l < 10 - m:
        print(end = "       ")
        l += 1
    n = m
    while n > 0:
        print("{}*{}={:<2}".format(n, m, m * n), end = " ")
        n -= 1
    print("\n")
    m += 1

print("=" * 80)
# while 循环方法4
m = 9
while m > 0:
    l = 1
    while l < 10 - m:
        print(end = "       ")
        l += 1
    n = m
    while n > 0:
        print("{}*{}={:<2}".format(n, m, m * n), end = " ")
        n -= 1
    print("\n")
    m -= 1
